<template>
	<view class="user">
		<userHead/>
		<div class="main">
		    <div class="tab-navs">
				<div :class="tab==0?'tab-nav center cur-tab':'tab-nav center'"   @click="tab = 0">
					<div class="user-tab house-icon"></div>
					<div>我的房源</div>
				</div>
				<div :class="tab==1?'tab-nav center cur-tab':'tab-nav center'"   @click="tab = 1">
					<div class="user-tab account-icon"></div>
					<div>我的账户</div>
				</div>
				<div :class="tab==2?'tab-nav center cur-tab':'tab-nav center'"   @click="tab = 2">
					<div class="user-tab feedback-icon"></div>
					<div>意见反馈</div>
				</div>
			</div>
			<div @click="load()">info</div>
			<div @click="base64()">base64</div>
			<div class="tab-content flexItem">
				 <accountList v-if="tab==0"/>
				 <account v-if="tab==1"/>
				 <feedback v-if="tab==2"/>
			</div>
		</div>
		
		<tabBar/>
	</view>
</template>

<script>
	import {
		useI18n
	} from 'vue-i18n'
	import mixins from '@/common/mixin.js'
	export default {
		mixins: [mixins],
		data() {
			return {
              tab:1,
			}
		},
		created() {
			this.t = useI18n().t
			this.load()
		},
		methods: {
			async load() {
              var res = await this.ajax('/wx/user/getInfo') 
			  console.log("查询用户", res);  
			  this.$store.dispatch("asyncApiUserInfo", res.data);
			},
			async api1() {
				var res = await this.ajax('/wx/property/sharePersonalCenter')
				console.log("base64=", res);   
				var res = await this.ajax('/wx/property/list')
				console.log("公共list=", res);   
				var res = await this.ajax('/wx/property/1')
				console.log("物业详情property=", res);   
				var res = await this.ajax('/wx/property/listByAuth')
				console.log("个人listByAuth=", res);   
				var res = await this.ajax('/wx/property/getInfoByAuth/1')
				console.log("个人物业详情property=", res);   
				 
				
				
				var res = await this.ajax('/wx/property/join/9') 
				console.log("参与分销join=", res);   
			},
			async api2() {
			  
			  var res = await this.ajax('/wx/property/cancelJoin/9')
			  console.log("退出分销cancelJoin=", res);   
			  var res = await this.ajax('/wx/notice/list')
			  console.log("公告信息", res);   
			  var res = await this.ajax('/wx/notice/7')
			  console.log("公告信息", res);   
			  var res = await this.ajax('/wx/dynamicMessage/list')
			  console.log("信息", res);    
			  var res = await this.ajax('/wx/dynamicMessage/1')
			  console.log("信息", res);    
			   
			   
			},  
			async shop(){
				var res = await this.ajax('/wx/inform/list')
				console.log("分销房源变动等列表", res);  
				var res = await this.ajax('/wx/inform/1')
				console.log("分销房源变动等信息", res);  
				var res = await this.ajax('/wx/invitationCode/genCode')
				console.log("生成邀请码", res);  
				
			},
			async base64(){
				 // 查看商品信息
				 var res = await this.ajax('/wx/goods/list')
				 var res = await this.ajax('/wx/goods/1')
				
			},
			async api4(){
				var res = await this.ajax('/wx/appointment/add',{
					 "appointmentTime":'2022-5-15 11:11:11',
					  "people": "test-by-me",
					  "phone": "13012341234",
					  "propertyId": 9,
					  "userId": 81
				},'POST')
				console.log("新增预约信息", res);   
				var res = await this.ajax('/wx/appointment/list')
				console.log("查询预约信息列表", res);   
				 var res = await this.ajax('/wx/appointment/1')
				 console.log("查询预约详情", res);   
			}
			// wx/inform/list /prod-api/wx/inform/list
		}
	}
</script>
<style lang="scss">
	page {
		background: #FFF;
	}

	.user {
		//visibility: hidden;
		display: flex;
		flex-direction: column;
		padding: 0 0vw;
        .tab-navs{
		   display: flex;
		  .tab-nav{
			  flex:1;
              background: #EEE; 
			  display: flex;
			  flex-direction: column;		
			  align-items: center;
			  justify-content: center;
			  font-size: 14px;
			  padding: 5px;
		  }
		  .cur-tab{
			  background: #FFF; 
		  }
		}
		.p-btn {
			width: 100px;
			margin: 10px;
		}
	}
</style>
